__author__="jregent"
__date__ ="$18.1.2009 16:30:20$"

# greeting.py
#
# Demonstration of the parsing module, on the prototypical "Hello, World!" example
#
# Copyright 2003, by Paul McGuire
#
from pyparsing import Word, alphas

# define grammar
greet = Word( alphas ) + "," + Word( alphas ) + "!"

# input string
hello = "Hello, World!"

# parse input string
print hello, "->", greet.parseString( hello )

kwdParse = "kwd:" + Word( alphas ) +"," + Word( alphas ) +"," + Word( alphas )+ "!" # <-- grammar defined here
textLine = 'kwd:Paroubek,chtivost penez,socialni spravedlnost!'
#print textLine, "->", kwdParse.parseString( textLine )

